package org.budo.dubbo.protocol.http.dispatcher.servlet;

import org.budo.support.lang.util.ListUtil;
import org.springframework.boot.web.servlet.ServletRegistrationBean;

/**
 * @author lmw
 */
public class BudoDubboHttpProtocolDispatcherServletRegistrationBean extends ServletRegistrationBean {
    public BudoDubboHttpProtocolDispatcherServletRegistrationBean() {
        this("/api/*");
    }

    public BudoDubboHttpProtocolDispatcherServletRegistrationBean(String urlMapping) {
        this.setName("BudoDubboHttpProtocolDispatcherServletRegistrationBean");
        this.setServlet(new BudoDubboHttpProtocolDispatcherServlet());
        this.setUrlMappings(ListUtil.toStringList(urlMapping));
    }
}